﻿using Microsoft.Practices.Unity;
using System;
using System.Data.SqlServerCe;

namespace WindowsFormsApplication2
{
    public class ProductsRepository : Repository<Product>
    {
        public ProductsRepository(IDbSettings settings)
            : base(settings)
        {

        }
        public override Product Map(SqlCeDataReader reader)
        {
            Product product = new Product();
            product.Id = Convert.ToInt32(reader["Id"]);
            product.Name = reader["Name"] as string;
            product.ProductNumber = reader["ProcuctNumber"] as string;
            return product;
        }
    }
}